/****************************************************************************
  From Qt Examples
****************************************************************************/

#ifndef ServerThread_H
#define ServerThread_H

#include <QThread>
#include <QTcpSocket>
#include <QDebug>

class ServerThread : public QThread
{
    Q_OBJECT

public:
    ServerThread(int socketDescriptor, const QString &fortune, QObject *parent);

    void run();

signals:
    void error(QTcpSocket::SocketError socketError);
    void clientMessage(QString);

    //new
public slots:
    void readyRead();
    void disconnect();
    void sendServerInformation(QString info);

private:
    int socketDescriptor; //new
    QTcpSocket *socket; //new
    QString text;
    quint16 blockS;
};

#endif
